package com.legendshop.openportal.sdk.model.request.v4;


import com.legendshop.openportal.sdk.annotation.DateValid;
import com.legendshop.openportal.sdk.model.PageRequest;
import com.legendshop.openportal.sdk.model.constants.OrderDateQueryTypeEnum;
import com.legendshop.openportal.sdk.model.constants.OrderSnTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

import static com.legendshop.openportal.sdk.model.constants.ApiPathConstantsV4.ORDER_PAGE_V4;

/**
 * 查询订单列表
 *
 */
@Data
@ApiModel("查询订单列表")
public class OrderPageV4Request extends PageRequest {

	/**
	 * 店铺id
	 */
	@NotNull(message = "店铺id不能为空")
	@ApiModelProperty(value = "店铺id")
	private Long shopId;

	/**
	 * 订单号
	 */
	@ApiModelProperty(value = "订单号")
	private String subNumber;

	/**
	 * 订单类型, 根据不同的类型来表示不同的订单，参见 OrderSnTypeEnum
	 */
	@ApiModelProperty(value = "订单类型，默认为订单号（TYPE_SUB_SN）")
	private OrderSnTypeEnum orderSnType;

	@DateValid(message = "开始时间格式不正确", ignoreEmpty = true)
	@ApiModelProperty(value = "开始时间，需与结束时间同时传")
	private String startDate;

	@DateValid(message = "结束时间格式不正确", ignoreEmpty = true)
	@ApiModelProperty(value = "结束时间，需与开始时间同时传")
	private String endDate;

	@ApiModelProperty(value = "时间查询类型，默认为更新时间")
	private OrderDateQueryTypeEnum dateQueryType;

	/**
	 * 用于订单搜索收件人手机
	 */
	@ApiModelProperty(value = "用于订单搜索收件人手机")
	private String mobile;

	/**
	 * 用于订单搜索收件人名称
	 */
	@ApiModelProperty(value = "用于订单搜索收件人名称")
	private String receiver;

	/**
	 * 用于订单搜索商品名称
	 */
	@ApiModelProperty(value = "用于订单搜索商品名称")
	private String prodName;


	@Override
	@ApiModelProperty(hidden = true)
	public String getApiPath() {
		return ORDER_PAGE_V4;
	}

}
